﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter8.Section6
{
    public class Example08
    {
        public Example08()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
        public void Compute()
        {
            V.Function.ToLastType<double, double, double, double> fxyz
                = new V.Function.ToLastType<double, double, double, double>(dxdydz);

            V.Function.ToLastType<double[], double> ff
              = new V.Function.ToLastType<double[], double>(volume);
            double[] from = { 0.0, 0.0, 0.0 };
            double[] to = { 1.0, 1.0, 1.0 };
            V.Volume v = new V.Volume(from,to,ff);

            V.IntegralOf3Form obj = new V.IntegralOf3Form(fxyz, v);
            obj.Compute();

            result += obj.Result.ToString() + "\r\n";

            result += (1.0).ToString() + "\r\n";
        }
        private double volume(double[] x)
        {
            return -1.0;
        }
        private double dxdydz(double x, double y, double z)
        {
            return x + z;
        }
    }
}
/*
1.00000506846092
1
*/

